package com.doudou.collection.adapter.controller.admin.system;

import com.doudou.collection.domain.service.admin.SysDictTypeService;
import com.doudou.collection.infrastructure.common.web.ResultVO;
import com.doudou.collection.orm.vo.admin.SysDictDataVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @ClassName SysDictDataController<br>
 * @Description 数据字典信息<br>
 * @Author 李浩文<br>
 * @Date 2023/7/5 22:19<br>
 * @Version 1.0<br>
 */
@Slf4j
@RestController
@Api(tags = "15.字典管理模块")
@RequestMapping("/prod-api/system/dict/data")
public class SysDictDataController {

    @Autowired
    private SysDictTypeService sysDictTypeService;


    @GetMapping("/type/{dictType}")
    @ApiOperation("根据字典类型查询字典数据信息")
    public ResultVO dictType(@PathVariable String dictType) {
        log.debug("正在处理【获取字典类型数据信息】的请求，参数：{}", dictType);
        List<SysDictDataVO> dictList = sysDictTypeService.listByType(dictType);
        return ResultVO.ok(dictList);
    }
}













